 <div class="row margin_top20">
      
<?php foreach($data as $vv){?> 
  <div class="col-sm-6 col-md-3">
    <div class="thumbnail">
          <div style="height: 250px;line-height: 250px;">
              <a href="/?Home/detail&gid=<?php echo $vv["id"];?>">
        <img src="<?php echo Common::getThumb($vv["image"],"300x300");?>" alt="">
              </a>
          </div>
     
          
          
          <ul class="list-group">
                     <li class="list-group-item"><h3>商品名称:<?php echo $vv["base_name"];?></h3></li>
                     <li class="list-group-item"><span class="glyphicon glyphicon-flag"></span>价格:<?php echo strip_tags($vv["sale_price"]);?>（元/斤）</li>
                     <li class="list-group-item"><p class="height100">描述:<?php echo strip_tags($vv["desc"]);?></p></li>
                     <li class="list-group-item">
                         <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-gid="<?php echo strip_tags($vv["id"]);?>" data-saleprice="<?php echo strip_tags($vv["sale_price"]);?>">下单</button>
                         <a href="/?Home/detail&gid=<?php echo $vv["id"];?>" class="btn btn-success pull-right">查看详情</a>
                     </li>
        </ul>
        

    </div>
  </div>
        <?php }?> 
      
      
      
      
</div>


 <?php if(isset($page_data)&&!empty($page_data)){?>
<div class="jppager">
            <nav>
  <ul class="pagination">
    <li>
        <a onclick="pageclick(this);" data-pageinfo="<?php echo $page_data["prev"]; ?>" data-cateinfo="<?php echo $cateid; ?>" href="javascript:void(0);" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    <?php for($i=1;$i<=$page_data["total_pages"];$i++){?>
    <?php if($page_data["cur"]-4>1&&$i==2){$i=$page_data["cur"]-4;}elseif($i==$page_data["cur"]+4&&$page_data["cur"] + 4 < $page_data["total_pages"]){$i = $page_data["total_pages"] - 1;}else{?>
    <li <?php if($i==$page_data["cur"]) echo "class='active'";?>><a onclick="pageclick(this);" data-pageinfo="<?php echo $i; ?>" data-cateinfo="<?php echo $cateid; ?>" href="javascript:void(0);"><?php echo $i;?></a></li>
    <?php }?>
    <?php }?>
    
    <li>
      <a onclick="pageclick(this);" data-pageinfo="<?php echo $page_data["next"]; ?>" data-cateinfo="<?php echo $cateid; ?>" href="javascript:void(0);" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>
</div>
<?php }?>
      
      
      